home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
Barrier.h,v
< prev
next >
Wrap
Text File
|
1989-02-23
|
3KB
|
204 lines
head 3.2;
branch ;
access ;
symbols ;
locks grunwald:3.2; strict;
comment @ * @;
3.2
date 89.02.20.15.32.07; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.49.32; author grunwald; state Exp;
branches ;
next 1.3;
1.3
date 88.10.30.13.05.33; author grunwald; state Exp;
branches ;
next 1.2;
1.2
date 88.09.28.22.13.39; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.18.16.42.02; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#ifndef Barrier_h
#define Barrier_h
//
// Barrier.h
// The barrier is initially closed.
//
#include "ReserveByException.h"
#include "FifoScheduler.h"
#include "SpinLock.h"
class Barrier : public ReserveByException {
SpinLock lock;
short pHeight;
short pCount;
short pLoops;
short generation;
FifoScheduler pPileOfThreads;
void releaseAll();
private:
virtual bool reserveByException(Thread *byWho);
public:
Barrier(int height, int loops = DefaultBarrierLoops);
virtual ~Barrier();
void rendezvous();
//
// lowerBarrier forces all waiting jobs to continue
//
void lowerBarrier();
//
// Changing the height of the barrier can cause people to continue
// if it is lowered below the current pCount.
//
int height();
void height(int h);
};
inline
Barrier::Barrier( int h, int l )
{
pHeight = h;
pLoops = l;
pCount = 0;
generation = 0;
}
inline int
Barrier::height()
{
return(pHeight);
}
#endif /* Barrier_h */
@
3.1
log
@Steay version
@
text
@@
1.3
log
@*** empty log message ***
@
text
@d22 1
a22 1
short count;
d38 11
a50 3
void rendezvous();
// virtual void classPrintOn(ostream&);
d58 1
a58 1
count = 0;
a65 6
}
inline void
Barrier::height(int h)
{
pHeight = h;
@
1.2
log
@*** empty log message ***
@
text
@d1 6
d17 1
a17 1
#include "HardSpinLock.h"
d20 1
a20 1
HardSpinLock lock;
d35 1
a35 1
Barrier(int height, int loops);
d42 1
a42 1
virtual void classPrintOn(ostream&);
@
1.1
log
@Initial revision
@
text
@d1 2
a2 2
#ifndef BARRIERH
#define BARRIERH
a5 11
//
// This implements a barrier synchronizer. Each barrier has a value
// known as the tripCount. When a barrier is release tripCount times,
// the barrier is down.
//
// When a barrier is lowered, all waiting processes are released and
// the barrier is raised again.
//
// If no process is waiting, the first process to reserve the barrier
// raises the barrier as it leaves.
//
d17 2
d29 1
a29 1
Barrier(int h);
d40 1
a40 1
Barrier::Barrier( int h )
d43 1
d45 1
d60 1
a60 1
#endif BARRIERH
@